﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AccountSettings.aspx.cs" Inherits="AccountSettings" MasterPageFile="~/NuTracker.master" %>
<asp:Content ContentPlaceHolderID="AreaMain" runat="server" ID="Default">
    <input type="hidden" id="hdnReturnURL" runat="server" />
    <style>
        .row{overflow:hidden;width:100%;clear:both;}
        .left{width:20%;float:left;text-align:right;}
        .right{width:80%;float:right;text-align:left;}
        ul#ui_height{margin:0;padding:0;}
        ul#ui_height li{list-style-type:none;display:none;margin:0;}
    </style>
    <script type="text/javascript">
        var aUnitPair = new Array();
        var nSelectedUnit;
        var aLi;
        var ddHeightUnit;
        $(document).ready(function() {
            aLi = $("#ui_height").children();
            ddHeightUnit = $("#ctl00_AreaMain_ddPrefHeightUnit");
            ddHeightUnit.change(function() {
                var o = $(this);
                nSelectedUnit = parseInt(o.val());
                for (var i = 0; i < aLi.length; i++) {
                    var li = $(aLi[i]);
                    if ((nSelectedUnit - 1) == i)
                        li.fadeIn();
                    else
                        li.hide();
                }
            });
            ddHeightUnit.trigger("change");
        });
    </script>
    <div class="row">
        <div class="left">First name:</div>
        <div class="right">
            <asp:TextBox ID="txtFirstName" runat="server" />
            <asp:RequiredFieldValidator ID="reqFirstName" runat="server" ErrorMessage="First name is required." ControlToValidate="txtFirstName"/>
        </div>
    </div>
    <div class="row">
        <div class="left">Last name:</div>
        <div class="right">
            <asp:TextBox ID="txtLastName" runat="server" />
            <asp:RequiredFieldValidator ID="reqLastName" runat="server" ErrorMessage="Last name is required." ControlToValidate="txtLastName"/>
        </div>
    </div>
    <div class="row">
        <div class="left">Email address:</div>
        <div class="right">
            <asp:TextBox ID="txtEmailAddress" runat="server" />
            <asp:RequiredFieldValidator ID="reqEmailAddress" runat="server" ErrorMessage="Email address is required." ControlToValidate="txtEmailAddress"/>
            <asp:RegularExpressionValidator ID="regValEmailAddress" runat="server" 
                ControlToValidate="txtEmailAddress" ErrorMessage="Invalid Email address format" 
                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" />
        </div>
    </div>
    <div class="row">
        <div class="left">Preferred height unit:</div>
        <div class="right">
            <asp:DropDownList ID="ddPrefHeightUnit" runat="server" />        
        </div>
    </div>
    <div class="row">
        <div class="left">Preferred weight unit:</div>
        <div class="right">
            <asp:DropDownList ID="ddPrefWeightUnit" runat="server" />        
        </div>
    </div>
    <div class="row">
        <div class="left">Your current height:</div>
        <div class="right">
            <ul id="ui_height">
                <asp:Repeater ID="rptHeightUI" runat="server">
                    <ItemTemplate>
                        <li>
                            <asp:TextBox ID="txtBxHeightUI" runat="server" />&nbsp;
                            <asp:Label ID="lblUnitAbbr" runat="server" />
                        </li>
                    </ItemTemplate>
                </asp:Repeater>
                <li><input id="txtHt_cm" type="text" size="3" maxlength="3" /> cm</li>
                <li><input id="txtHt_mt" type="text" size="4" maxlength="4" /> m</li>
                <li><input id="txtHt_ft" type="text" size="1" maxlength="1" /> ft <input id="txtHt_in" type="text" size="2" maxlength="2" /> in</li>
            </ul>
            <input type="hidden" id="hdnSysValue" />
        </div>
    </div>
    <div class="row">
        <div class="left">&nbsp;</div>
        <div class="right" style="text-align:right">
            <asp:Button ID="btnCancel" runat="server" Text="Cancel" 
                onclick="btnCancel_Click" />
            <asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" />
        </div>
    </div>
    <div class="row">
        <asp:PlaceHolder ID="phDisplayDataSet" runat="server" />
    </div>
</asp:Content>